package com.itheima.Demo01.demo04;




public class MyThred04 extends Thread {
    private int count = 0;
    private Object lock = new Object();

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            synchronized (lock) {
                count++;
                System.out.println("送了" + count + "个冰淇淋");
            }
        }
    }
}
